package com.atguigu.gmall.all.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

@Controller
public class TestThymeleafController {

    @GetMapping("/thymeleaf/test")
    public String testThymeleaf(HttpServletRequest request, Model model){
        request.setAttribute("hello","request");

        List<String> list = new ArrayList<>();
        list.add("小A");
        list.add("小b");
        model.addAttribute("persons",list);

        return "test";
    }

}
